Update a campaign with a full payload. Requires a SERVER API token. The account_id is derived from the access token and must not be sent in the request body. The type query parameter must match the existing campaign type. Updates reject missing campaigns, invalid payloads, and blocked sensitive changes. Ended campaigns cannot be updated. Started campaigns cannot update start_date, attributes, rules, or brand_id, and end_date cannot be moved to the past.
Documentation Index
Fetch the complete documentation index at: https://docs.masivo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The campaign unique identifier
The campaign type
BEHAVIOR, COUPONS, PUNCH_CARDS, REFERRALS Storefront campaign write payload. Send the campaign type as the required type query parameter, not in the body. The body mirrors the dashboard campaign form for that type. account_id is derived from the SERVER token. Common validation: rules must contain at least one main/referrer rule, metadata must be a JSON object encoded as a string, budget must be at least 1, labels and platforms use dashboard select values, and dates must follow the campaign date restrictions.
The brand id of the campaign, null if is a global campaign
Platform select values where this campaign applies
The name of the campaign
The description of the campaign
JSON string with the main/referrer campaign rules. Must contain at least one rule for every campaign type, including REFERRALS. referee_rules_json does not replace this field.
The attributes of the campaign
The persisted campaign status for create/update requests
ACTIVE, INACTIVE The start date of the campaign. On create, and on updates for scheduled campaigns, it must be today or later and less than one year from now.
When true, end_date must be omitted and the campaign is stored without an end date.
The end date of the campaign. Omit it when withoutEndDate is true. When provided, it must be after start_date and less than one year from start_date.
Who is funding these campaign
The budget of the campaign
1000
daily, weekly, monthly, total Label select values
JSON object encoded as a string
COUPONS only. Number of coupon codes to generate or keep. Must be positive and within the safe limit for generated codes.
COUPONS only. When true, customCodes is used instead of generated codes
COUPONS only. Comma-separated custom coupon codes. Required to contain at least one non-empty code when useCustomCodes is true.
COUPONS update only. Required as true when changing code format or quantity
REFERRALS only. JSON string with referee campaign rules. This is optional and does not replace the required main/referrer rules field.
Campaign updated
Campaign response. account_id, order, and created_at are not returned.